package com.whmskj.xjlhsc.mobie.Scheduling.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.mobie.Scheduling.Dto.EmpDTO;
import com.whmskj.xjlhsc.mobie.Scheduling.Dto.EmployeePerformanceDTO;
import com.whmskj.xjlhsc.mobie.Scheduling.Service.EmployeePerformanceService;
import com.whmskj.xjlhsc.mobie.Scheduling.vo.EmployeePerformanceControllerVO;
import com.whmskj.xjlhsc.mobie.Scheduling.vo.IndividualPerformanceVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author jiaruchun
 * @date 2025-09-04 15:48
 */
@SaIgnore
@RestController
/*员工绩效*/
@RequestMapping("/api/employeePerformance")
public class EmployeePerformanceController {

    @Autowired
    public EmployeePerformanceService employeePerformanceService;

    /**
     * 按工序查询工种
     * @param process
     * @return
     */
    @GetMapping("/getWorkByProcess")
    public Result getWorkByProcess(@RequestParam("process") String process) {
        return Result.success(employeePerformanceService.getWorkByProcess(process));
    }

    @PostMapping("/list")
    public Result getEmployeePerformance(@RequestBody EmployeePerformanceDTO employeePerformanceDTO) {
        return Result.success(employeePerformanceService.getEmployeePerformanceControllerVO(employeePerformanceDTO));
    }

    @PostMapping()
    private Result getIndividualPerformanceVO(@RequestBody EmpDTO empDTO){
        return Result.success(employeePerformanceService.getIndividualPerformanceVO(empDTO));
    }

}
